package com.example.springsecuritydemo2.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class HelloController {
    @GetMapping("/hello")
    @PreAuthorize("hasAuthority('select')") //权限本身就是使用字符串来进行管理的
    public String hello(){
        return "hello world";
    }
}
